package sn.hn.demo;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.Button;
import android.widget.TextView;

public class MyCustomDialog extends Dialog{
	public boolean isRestart = false;
	Button btnRestart;
	TextView tvContent;
	public MyCustomDialog(Context context) {
		super(context);
		isRestart = false;
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dialog);
		setTitle("Game Over");
		this.getWindow().setLayout(MainActivity.SCREENWIDTH/2, MainActivity.SCREENHEIGHT/2);
		btnRestart = (Button)findViewById(R.id.btnRestart);
		btnRestart.setOnTouchListener(new OnTouchListener() {
			@Override
			public boolean onTouch(View v, MotionEvent event) {
				MyCustomDialog.this.dismiss();
				isRestart = true;
				return true;
			}
		});
	}

}
